﻿<!-- 正文开始 -->
<div class="layui-fluid">
    <div class="layui-card">
        <div class="layui-card-body">
            <div class="layui-form toolbar">
                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label w-auto">搜索：</label>
                        <div class="layui-input-inline mr0">
                            <input name="keyword" class="layui-input" type="text" placeholder="输入关键字"/>
                        </div>
                    </div>
                    <div class="layui-inline">
                        <button class="layui-btn icon-btn" lay-filter="formSubSearchBarcode" lay-submit>
                            <i class="layui-icon">&#xe615;</i>搜索
                        </button>
                    </div>
                </div>
            </div>

            <table class="layui-table" id="tableBarcode" lay-filter="tableBarcode"></table>
        </div>
    </div>
</div>

<script>
layui.use(['layer', 'form', 'table', 'util', 'admin', 'zTree', 'config','element'], function () {
        var $ = layui.jquery;
        var layer = layui.layer;
        var form = layui.form;
        var table = layui.table;
        var util = layui.util;
        var admin = layui.admin;
        var config = layui.config;
        var treetable = layui.treetable;
        var treeSelect=layui.treeSelect;
        var config = layui.config;
        var element = layui.element; //Tab的切换功能，切换事件监听等，需要依赖element模块
		
		var cabId = '#(cabId)';
        // 渲染表格
        var insTb = table.render({
            elem: '#tableBarcode',
            url: '#(ctx)/biz/barcode/listData',
            page: true,
            where: {cabId: cabId},
            cellMinWidth: 100,
            cols: [[
                {type: 'numbers'},
                {field: 'orgName', sort: false, title: '部门'},
                {field: 'name', sort: false, title: '内容'},
                {field: 'createUserName', sort: false, title: '操作人'},
                {field: 'createTime', sort: false, title: '操作时间'},
            ]]
        });

        // 搜索
        form.on('submit(formSubSearchBarcode)', function (data) {
            insTb.reload({where: data.field}, 'data');
        });
        
    });
</script>